-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable HW acceleration on Aztec when it crashes on Android 8 - Release Gutenberg to v1.15.1 #10620
Conversation
…ed the data siteID+postID about posts that crashed in Aztec on Android 8
…tore the preference to disable HW Acc. the next time the post is loaded in the Aztec Editor
You can test the changes on this Pull Request by downloading the APK here. |
WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefs.java
Outdated
Show resolved
Hide resolved
libs/editor/WordPressEditor/src/main/java/org/wordpress/android/editor/AztecEditorFragment.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Managed to reproduce the crash by
- setting visibility=gone to the editor title,
- removing the crash preventer InputFilter in AztecText (in
setupKeyListenersAndInputFilters()
), - make sure the site is not private (so crash logging is enabled)
- adding a captioned image to a draft post
- the image needs to be large, like, occupying more than it fits the view (for example, even a screenshot of the device which is tall enough to exceed the editor window)
- open the post and scroll the image a bit, so you can see the middle of the image but can’t see where the cursor is, nor your characters
- then trying to insert something at the beginning (as per the crash described in aztec repo)
With this I was able to test and found some problems, left comments there in the PR (https://github.com/wordpress-mobile/WordPress-Android/pull/10620/files#r337038375 and https://github.com/wordpress-mobile/WordPress-Android/pull/10620/files#r337053623), I think once these problems are fixed we should be good to go 👍
Just a note on my steps to reproduce above:
this means that given we are relying on the logger for this solution, and we only have logging enabled for public sites, private sites won’t have the solution enabled. I think we can go with this for now, adding some Tracks information when we mark a Post for HW acceleration disabling (and when we open a post with HW acceleration disabled) and see how it goes, what do you think? |
…ss-Android into issue/8828-Aztec-crash-Android-8 * 'develop' of https://github.com/wordpress-mobile/WordPress-Android: (29 commits) Make utils sinletons Handle case without a browser FluxC hash updated to 1.5.1-beta-3 Add signup flow name parameter to signup auth email request Change FluxC hash to 1.5.1-beta-2 Update gutenberg-mobile ref to v1.15.0 release CircleCI: Bump Orbs to use any 1.0.x version Update gutenberg ref Update gutenberg ref Add NEW_TASK flag to the open file intent Update to Aztec v1.3.33, including gutenberg's ref Update gutenberg ref Update Aztec ref to v1.3.32 Update RELEASE-NOTES with block editor improvements Enable downloads from private sites Update gutenberg ref to release 1.15.0 capitalizeWithLocaleWithoutLint string extension introduced Implement specific comparison for LocalOrRemoteId in PostListDiffItemCallback Fix staticFieldLeak errors in lint-baseline.xml Refresh data on request completed ... # Conflicts: # libs/editor/WordPressEditor/build.gradle # libs/gutenberg-mobile
can go with this for now, adding some Tracks information when we mark a Post for HW acceleration disabling (and when we open a post with HW acceleration disabled) and see how it goes, what do you think? I've added the If that's ok for you we can merge this 3 PRs tomorrow! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR tries to mitigate #8828 by catching the crash reported by Aztec, and disabling HW acceleration on the current post. (The postID is stored in AppPrefs. Next time the users load the same post, the app turns HW acceleration off for the whole Aztec Fragment).
The original problem, as discussed with details in #8828, is deep inside the Android 8 Framework, and there is no way for us to prevent it. We found out that disabling HW acc. does fix it.
Unfortunately we cannot disable HW acc. on all posts, since without HW acc. the Aztec editor is kind of slow even on recent devices. More, the problem doesn't happen all the times, but only when the users follow some edit patterns (we cannot repro it btw) that make it happen.
In details:
android.text.DynamicLayout.getBlockIndex(DynamicLayout.java:646)
Note: Unfortunately this PR does act after the fact, and probably we won't see crash report numbers disappear completely.
As a further improvement to this, we may want to add (?) a global app setting, say "Aztec compatibility mode" that we switch to ON the first this crash happens, and notify the user about that, and give the instructions on how to turn it OFF in App->Settings.
cc @designsimply
This PR also updates Gutenberg to v1.15.1
gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#1479
TODO:
PR submission checklist:
[ x ] I have considered adding unit tests where possible.
[ x ] I have considered if this change warrants user-facing release notes and have added them to
RELEASE-NOTES.txt
if necessary.